import Vue from "vue";
import VueRouter from "vue-router";
import home from "@/views/Home.vue";
import discovery from "@/views/discovery";
import playlists from "@/views/playlists";
import newsongs from "@/views/newsongs";
import newmv from "@/views/newmv";
import playlist from "@/views/playlist";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: "/home",
    name: "home",
    component: home,
    redirect: "/discovery",
    children: [
      {
        path: "/discovery",
        name: "discovery",
        component: discovery
      },
      {
        path: "/playlists",
        name: "playlists",
        component: playlists
      },
      {
        path: "/newsongs",
        name: "newsongs",
        component: newsongs
      },
      {
        path: "/newmv",
        name: "newmv",
        component: newmv
      },
      {
        path: "/playlist/:id",
        name: "playlist",
        component: playlist
      }
    ]
  }
];

const router = new VueRouter({
  routes
  // mode: "history"
});

export default router;
